package com.ljx.controller;

import java.io.File;
import java.nio.charset.MalformedInputException;
import java.util.HashMap;
import java.util.Map;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class FileUploadController {
	@RequestMapping("/001")
	public Map<String, Object> file(MultipartFile filename) throws Exception{
		System.out.println(filename.getOriginalFilename());
		filename.transferTo(new File("D:/"+filename.getOriginalFilename()));
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("msg", "ok");
		return map;	
	}
}
